home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / mgr / sparcmgr / src.zoo / src / blit / asm.h next >
Encoding:
C/C++ Source or Header  |  1989-09-18  |  1.9 KB  |  87 lines

  1. /*                        Copyright (c) 1988 Bellcore
  2.  *                            All Rights Reserved
  3.  *       Permission is granted to copy or use this program, EXCEPT that it
  4.  *       may not be sold for profit, the copyright notice must be reproduced
  5.  *       on copies, and credit should be given to Bellcore where it is due.
  6.  *       BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM.
  7.  */
  8. /*    $Header: asm.h,v 4.1 88/06/21 13:18:55 bianchi Exp $
  9.     $Source: /tmp/mgrsrc/src/blit/RCS/asm.h,v $
  10. */
  11. static char    h_asm_[] = "$Source: /tmp/mgrsrc/src/blit/RCS/asm.h,v $$Revision: 4.1 $";
  12.  
  13. /* asm declarations for sun asm */
  14.  
  15. /* bit operations */
  16.  
  17. #define BF_EXT(value,where,offset,width) \
  18.             asm("    bfextu where@{offset:width},value")    
  19.  
  20. #define BF_INS(value,where,offset,width) \
  21.             asm("    bfins    value,where@{offset:width}")    
  22.  
  23. #define BF_SET(where,offset,width) \
  24.             asm("    bfset    where@{offset:width}")    
  25.  
  26. #define BF_CLR(where,offset,width) \
  27.             asm("    bfclr    where@{offset:width}")    
  28.  
  29. #define BF_INV(where,offset,width) \
  30.             asm("    bfchg    where@{offset:width}")    
  31.  
  32. /* other useful asm's */
  33.  
  34. #define LABEL(x) \
  35.             asm("x:")
  36.  
  37. #define GOTO(x) \
  38.             asm("    jmp    x")
  39.  
  40. #define MOVE(src,dst) \
  41.             asm("    movl    src,dst")
  42.  
  43. #define LOOP(what,where) \
  44.             asm("    dbf    what,where")
  45.  
  46. #define ADD(what,where) \
  47.             asm("    addl    what,where")
  48.  
  49. #define SUB(what,where) \
  50.             asm("    subl    what,where")
  51.  
  52. /* basic logical operations */
  53.  
  54. #define AND(what,where) \
  55.             asm("    andl    what,where")
  56.  
  57. #define OR(what,where) \
  58.             asm("    orl    what,where")
  59.  
  60. #define XOR(what,where) \
  61.             asm("    eorl    what,where")
  62.  
  63. /* 3 flavors of complement */
  64.  
  65. #define NOT(what) \
  66.             asm("    notl    what")
  67.  
  68. #define NOT_DST(what,where) \
  69.             asm("    notl    what")
  70.  
  71. #define NOT_SRC(what,where) \
  72.             asm("    notl    where")
  73.  
  74. /* place holder operation */
  75.  
  76. #define NOP(x,y) \
  77.             asm("    # no operation on x,y")
  78.  
  79. /* other might be useful */
  80.  
  81. #define MOVEQ(data,dst) \
  82.             asm("    moveq    #data,dst")
  83.  
  84. #define NEG(what) \
  85.             asm("    negl    what")
  86.  
  87.